
class Employee:
    _ID = 0
    name = ""
    age = 0
    #构造器
    def __init__ (self,name,age):
                 self.name = name
                 self.age = age

                 self.id = self._ID
                 self.__class__._ID += 1
    def sayHello(self):
                print("hello {}".format(self.name))

em = Employee("Mr.Ding",20)
print(em.name)
print(em._ID)
#实例2
em2 = Employee("Ms.Zhou",20)
print(em2.name)
print(Employee._ID)
em2.sayHello()
print("⼀共实例化了{}个实例".format(Employee._ID))


